package com.sise.controller.wechat;

import com.sise.service.IProductBrowseRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zj
 */
@RestController
@RequestMapping("/sise/wechat/product-browse-record")
public class WechatProductBrowseRecordController {

    @Resource
    private IProductBrowseRecordService productBrowseRecordService;

    @RequestMapping("/browseProduct")
    public String browseProduct(String openId, Integer productId) {
        boolean isAddOrUpdate = productBrowseRecordService.addOrUpdateProductBrowseRecord(openId, productId);
        if (isAddOrUpdate) {
            return "添加或修改成功！";
        }
        return "添加或修改失败！";
    }
}
